#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

void maxmin(int array[])
{
	int* pmax;
	int* pmin;
	int* p;
	pmax = pmin = array;
	for (p = array + 1; p < array + 10; p++)
	{
		if (*p > *pmax)
			pmax = p;
		else if (*p < *pmin)
			pmin = p;
	}
	*p = array[0];
	array[0] = *pmin;
	*pmin = *p;
	*p = array[9];
	array[9] = *pmax;
	*pmax = *p;
}


int main()
{
	int num[10];
	int i = 0;
	for (i = 0; i < 10; i++)
		scanf("%d", &num[i]);
	maxmin(num);
	for (i = 0; i < 10; i++)
		printf("%d ", num[i]);

	return 0;
}

#include<stdio.h>

void copy_string(char* from, char* to)
{
	while ((*from) != '\0')
	{
		*to = *from;
		from++,
		to++;
	}
	*to = '\0';
}

int main()
{
	char* pa = "I am a teacher.";
	char* pb = "You are a student.";
	printf("string_a=%s\nstring_b=%s\n", pa, pb);
	copy_string(pa, pb);
	printf("string_a=%s\nstring_b=%s\n", pa, pb);


	return 0;
}

#include<stdio.h>

void delete(char* p, char ch)
{
	char* q = p;
	while ((*p) != '\0')
	{
		if (*p != ch)
		{
			*q = *p;
			q++;
		}
		p++;
	}
	*q = '\0';

}


int main()
{

	char str[50];
	char* a=str;
	char ch;
	printf("Please input the string:\n");
	gets(str);
	printf("Please input the char you want to delete:\n");
	ch=getchar();
	delete(a, ch);
	printf("The deleted string is : %s\n",str);

	return 0;
}

#include<stdio.h>

int max(int a, int b)
{
	if (a > b)
		return a;
	else
		return b;
}

int main()
{
	int a = 0;
	int b = 0;
	int (*pmax)();
	scanf("%d%d", &a, &b);
	pmax = max;
	int z = (*pmax)(a, b);
	printf("%d\n", z);

	return 0;
}

